﻿import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    mode:'hash',
    base: process.env.BASE_URL,
    routes: [
        {
            path: '/',
            redirect: '/index'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            name:'home',
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' },
                    name:'dashboard',
                },
                {
                    path: '/icon',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/Icon.vue'),
                    meta: { title: '自定义图标' },
                    name:'icon',
                },
                {
                    path: '/table',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/BaseTable.vue'),
                    meta: { title: '基础表格' },
                    name:'table',
                },
                {
                    path: '/tabs',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/page/Tabs.vue'),
                    meta: { title: 'tab选项卡' },
                    name:'tabs',
                },
                {
                    path: '/form',
                    component: () => import(/* webpackChunkName: "form" */ '../components/page/BaseForm.vue'),
                    meta: { title: '基本表单' },
                    name:'form',
                },
                {
                    // 富文本编辑器组件
                    path: '/editor',
                    component: () => import(/* webpackChunkName: "editor" */ '../components/page/VueEditor.vue'),
                    meta: { title: '富文本编辑器' },
                    name:'editor',
                },
                {
                    // markdown组件
                    path: '/markdown',
                    component: () => import(/* webpackChunkName: "markdown" */ '../components/page/Markdown.vue'),
                    meta: { title: 'markdown编辑器' },
                    name:'markdown',
                },
                {
                    // 图片上传组件
                    path: '/upload',
                    component: () => import(/* webpackChunkName: "upload" */ '../components/page/Upload.vue'),
                    meta: { title: '文件上传' },
                    name:'upload',
                },
                {
                    // vue-schart组件
                    path: '/charts',
                    component: () => import(/* webpackChunkName: "chart" */ '../components/page/BaseCharts.vue'),
                    meta: { title: 'schart图表' },
                    name:'charts',
                },
                {
                    // 拖拽列表组件
                    path: '/drag',
                    component: () => import(/* webpackChunkName: "drag" */ '../components/page/DragList.vue'),
                    meta: { title: '拖拽列表' },
                    name:'drag',
                },
                {
                    // 拖拽Dialog组件
                    path: '/dialog',
                    component: () => import(/* webpackChunkName: "dragdialog" */ '../components/page/DragDialog.vue'),
                    meta: { title: '拖拽弹框' },
                    name:'dialog',
                },
                {
                    // 国际化组件
                    path: '/i18n',
                    component: () => import(/* webpackChunkName: "i18n" */ '../components/page/I18n.vue'),
                    meta: { title: '国际化' },
                    name:'i18n',
                },
                {
                    // 权限页面
                    path: '/permission',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/Permission.vue'),
                    meta: { title: '权限测试', permission: true },
                    name:'permission',
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' },
                    name:'404',
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' },
                    name:'403',
                },
                {
                    path: '/donate',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/Donate.vue'),
                    meta: { title: '支持作者' },
                    name:'donate',
                },
                // 自定义页面(后台)
                {
                    path: '/personal',
                    component: () => import('../components/page/Personal.vue'),
                    meta: {title: '个人中心'},
                    name:'personal',
                },
                {
                    path: '/personal/password',
                    component: () => import('../components/page/Password.vue'),
                    meta: {title: '修改密码'},
                    name:'password',
                },
				{
				    path: '/course/choose',
				    component: () => import('../components/page/StudentCourseChoose.vue'),
				    meta: {title: '选课'},
				    name:'courseChoose',
				},
                {
                    path: '/manage',
                    component: () => import('../components/common/Manage.vue'),
                    name:'manage',
                    children: [
                        {
                            path: 'course',
                            component: () => import('../components/page/ManageCourse.vue'),
                            meta: {title: '课程管理'},
                            name:'course',
                        },
                        {
                            path: 'student',
                            component: () => import('../components/page/ManageStudent.vue'),
                            meta: {title: '学生管理'},
                            name:'student',
                        },
                        {
                            path: 'teacher',
                            component: () => import('../components/page/ManageTeacher.vue'),
                            meta: {title: '教师管理'},
                            name:'teacher',
                        },
                        {
                            path: 'manager',
                            component: () => import('../components/page/ManageManager.vue'),
                            meta: {title: '管理员管理'},
                            name:'manager',
                        },

                    ]
                },
                {
                    path: '/grade',
                    component: () => import('../components/common/Grade.vue'),
                    name: 'grade',
                    children: [
                        {
                            path: 'input',
                            component: () => import('../components/page/GradeInput.vue'),
                            meta: {title: '成绩录入'},
                            name:'gradeInput',
                        },
                        {
                            path: 'manage',
                            component: () => import('../components/page/GradeManage.vue'),
                            meta: {title: '学生成绩'},
                            name:'gradeManage',
                        }
                    ]
                },
                {
                    path: '/teacher',
                    component: () => import('../components/common/Teacher.vue'),
                    name: 'teacher',
                    children: [
                        {
                            path: 'course',
                            component: () => import('../components/page/ViewCourse.vue'),
                            meta: {title: '课程查看'},
                            name:'teacher_course',
                        },
                        {
                            path: 'student',
                            component: () => import('../components/page/ViewStudent.vue'),
                            meta: {title: '学生查看'},
                            name:'teacher_student',
                        }
                    ]
                },
                // 学生部分
                {
                    path: '/student',
                    component: () => import('../components/common/Student.vue'),
                    name: 'student',
                    children: [
                        {
                            path: 'studentCourse',
                            component: () => import('../components/page/StudentCourse.vue'),
                            meta: {title: '课表查询'},
                            name:'StudentCourse'
                        },
                        {
                            path: 'courseChoose',
                            component: () => import('../components/page/StudentCourseChoose.vue'),
                            meta: {title: '学生选课'},
                            name:'courseChoose'
                        },
                         {
                             path: 'comment',
                             component: () => import('../components/page/StuComment.vue'),
                             meta: {title: '课程评价'},
                             name:'StuComment'
                         },
                        
                    ]
                },
                {
                    path: '/settings',
                    component: () => import('../components/common/manageSetting.vue'),
                    name: 'settings',
                    children: [
                        {
                            path: 'news',
                            component: () => import('../components/page/news.vue'),
                            meta: {title: '新闻展示'},
                            name:'news',
                        },
                        {
                            path: 'openGrade',
                            component: () => import('../components/page/openGrade.vue'),
                            meta: {title: '成绩录入通道管理'},
                            name:'openGrade',
                        }
                    ]
                }
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' },
            name:'login',
        },
        
        // 自定义页面
        {
            path: '/index',
            component: () => import('../components/page/Index.vue'),
            meta: { title: '主页' },
            name:'index',
        },
		{
		    path: '/news/detail',
		    component: () => import('../components/page/NewsDetail.vue'),
		    meta: {title: '新闻详情'},
		    name:'detail',
		},
        {
            path: '/courses/detail',
            component: () => import('../components/page/CoursesDetail.vue'),
            meta: {title: '详情'},
            name:'detail',
        },
        {
            path: '/courses',
            component: () => import('../components/page/Courses.vue'),
            meta: {title: '列表'},
            name:'courses',
        }

        // {
        //     path: '*',
        //     redirect: '/404'
        // }
        
    ]
});
